<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script src="lodash.js"></script>
    <script>
        var objA = {
            "name": "colin",
            sister:{
                name:'lily'
            }
        }

        // function cloneDeep(obj){
        //     var myobj = {}
        //     for(var i in obj){
        //         if(typeof obj[i] == 'object'){
        //             myobj[i] = cloneDeep(obj[i])
        //         }else{
        //             myobj[i] = obj[i]
        //         }
        //     }
        //     return myobj 
        // }

        // var objB = cloneDeep(objA)
        // console.log(objB.sister == objA.sister)

        
        // // Lodash
        var objB = _.cloneDeep(objA);
        console.log(objB.sister == objA.sister)
        
    </script>
</body>
</html>